import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:photo_view/photo_view.dart';


class ScreenPage extends StatelessWidget{
  const ScreenPage({
    Key? key,
    required this.path,
    required this.isCanDel,
    this.deleteImageCallback,//删除图片毁掉

  }) :super(key: key);

  final bool isCanDel;
  final String path;
  final Function? deleteImageCallback;

  @override
  Widget build(BuildContext context) {

    return Scaffold(
      body: PhotoView(
          imageProvider:NetworkImage(path)
      ),
      floatingActionButton: isCanDel==true?FloatingActionButton(
        backgroundColor:Colors.black,
        child: const Icon(Icons.delete_forever_rounded,color: Colors.white,),
        onPressed: (){
          if(deleteImageCallback!=null){
            deleteImageCallback!(path);
            Navigator.pop(context);
          }
        },
      ):null,
    );
  }

}